home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 8: LINUX Games / Linux Cubed Series 8 - LINUX Games.iso / games / x11 / rpg / crossfir.92 / crossfir / crossfire-0.92.5 / doc / spoiler / sorter < prev    next >
Text File  |  1996-07-24  |  402b  |  25 lines

  1. BEGIN {
  2. a=11;
  3. b=12;
  4. halv=int(lengde/2);
  5. hopp=lengde-(2*halv);
  6. lim=halv+hopp;
  7. }
  8. {
  9.    str = toupper(substr($0, 1, 1)) substr($0, 2);
  10.    if (NR>lim) { num=b; b+=2;}
  11.    else { num=a; a+=2;}
  12.  
  13.    if (NR>halv) hale="\\\\\n";
  14.    else hale="& \n";
  15.  
  16.    if (hopp && NR==lim)
  17.    {
  18.       hale="";
  19.       for (i=0; i<NF ; i++) hale=hale "& ";
  20.       hale=hale "\\\\\n";
  21.    }
  22.  
  23.    printf("%d &%s %s", num, str, hale);
  24. }
  25.